#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMouseEvent>
#include <QEvent>
#include <QSystemTrayIcon>
#include <QAction>
#include <QMenu>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
protected:
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseDoubleClickEvent(QMouseEvent *event);
    void closeEvent(QCloseEvent *event);
private slots:
    void on_min_btn_clicked();

    void on_close_btn_clicked();

    void on_user_btn_clicked();

    void on_data_btn_clicked();

    void on_chart_btn_clicked();

    void on_export_btn_clicked();

    void on_max_btn_clicked();

    void showWindow();//显示窗体

    void quitApp();//退出

    void on_activatedSysTrayIcon(QSystemTrayIcon::ActivationReason);
signals:
    void signOtherChart(QString,QMap<QString , int>);
private:
    Ui::MainWindow *ui;
    bool mouse_press = 1;
    QPoint move_point;
    uint16_t sourcex_ = 0 ;
    uint16_t sourcey_ = 0 ;
    uint16_t sourcew_ = 0 ;
    uint16_t sourceh_ = 0 ;
    QSystemTrayIcon m_systemTray;
    QMenu *m_menu;
    QAction *m_action1;
    QAction *m_action2;
};
#endif // MAINWINDOW_H
